package com.hxm.demo.java;

import cn.hutool.core.io.FileUtil;
import cn.hutool.http.HttpUtil;

import java.util.Arrays;
import java.util.List;

/**
 * @author huangxiaoming
 * @date 2020/8/13
 **/
public class Test {

    public static void main(String[] args) {
        List<String> urls = Arrays.asList(
                "https://fileddl.ctaiot.com/dlabel/1/person/mycloud/img/e6429255-d62a-483d-9938-59c34b74402f.png",
                "https://fileddl.ctaiot.com/dlabel/1/person/mycloud/img/70248b22-c81e-4ab2-a0f6-caa73575d68e.png"
                );

        for (int i = 0; i < urls.size(); i++) {
            long size = HttpUtil.downloadFile(urls.get(i), FileUtil.file("E:\\img"));
            System.out.println("Download number: " + i +",Download size: " + size);
        }
    }
}
